<template>
  <!-- <iframe class="docsIframe" :src="docsAttachment[0].url" frameborder="0" /> -->
  <embed class="docsIframe" type="application/pdf" :src="url">
</template>

<script>
import ajaxApi from '@/view/ajax-api/index.js'
import dataApi from './data-api'
export default {
  data () {
    return {
      url: ''
    }
  },
  computed: {
    baseUrl () {
      return dataApi.core.docsAttachment.list[0].url
    }
  },
  watch: {
    async baseUrl (baseUrl) {
      this.url = await ajaxApi.getPlayDownloadUrl(baseUrl)
    }
  },
  async created () {
    this.url = await ajaxApi.getPlayDownloadUrl(this.baseUrl)
  }
}
</script>

<style scoped>
.docsIframe {
  width: 100%;
  height: 100%;
}
</style>
